<?php

class XmlController extends Controller
{
	
	
	public function actionItemCodes()
	{
		$item = new Item;
		$itemList = $item->findAll();
		
		header ("Content-Type:text/xml");  
		
		echo "<?xml version=\"1.0\"?><complete>";
		
		foreach ($itemList as $item)
		{
			echo "<option value=\"{$item->id}\">{$item->code}</option>";
		}
		
		echo "</complete>";
		
	}
	
	public function actionItemNames()
	{
		$item = new Item;
		$itemList = $item->findAll();
		
		header ("Content-Type:text/xml");  
		
		echo "<?xml version=\"1.0\"?><complete>";
		
		foreach ($itemList as $item)
		{
			echo "<option value=\"{$item->id}\">{$item->short_description}</option>";
		}
		
		echo "</complete>";
		
	}
}